import QtQuick 2.8
import QtQuick.Controls 2.1
import QtQuick.Layouts 1.3
import "./controls"

Pane {
    id: root

    property alias menuAvatar: avatar.source
    property string menuOption: {
        if(menu_chat.checked)
            return "chat";
        else if(menu_contact.checked)
            return "contact";
        else if(menu_read.checked)
            return "read";
        else
            return "";
    }

    background: Rectangle {
        anchors.fill: parent
        color: "#1f1f1f"
    }

    ButtonGroup { id: menuGroup }

    ColumnLayout {
        anchors.fill: parent
        anchors.topMargin: 20
        anchors.bottomMargin: 0
        spacing: 16

        Image {
            id: avatar
            sourceSize.width: 36
            sourceSize.height: 36
        }

        MenuButton {
            id: menu_chat
            Layout.alignment: Qt.AlignHCenter
            source: "qrc:/images/menu_chat.png"
            ButtonGroup.group: menuGroup
            checked: true
        }

        MenuButton {
            id: menu_contact
            Layout.alignment: Qt.AlignHCenter
            source: "qrc:/images/menu_contact.png"
            ButtonGroup.group: menuGroup
        }

        MenuButton {
            id: menu_read
            Layout.alignment: Qt.AlignHCenter
            source: "qrc:/images/menu_read.png"
            ButtonGroup.group: menuGroup
        }

        // Fill blank
        Item { Layout.fillHeight: true }

        MenuButton {
            checkable: false
            implicitWidth: 30
            implicitHeight: 30
            Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
            source: "qrc:/images/menu_set.png"
        }
    }
}
